package com.smalls.redshoes.ui.widget;

import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.BitmapDrawable;
import android.view.View;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.smalls.redshoes.R;

public abstract class MyPopup {
    private static String TAG = com.smalls.newvideotwo.utils.Constant.baddcoolio2tag? com.smalls.newvideotwo.utils.Constant.TAGPREFIXSTR + MyPopup.class.getSimpleName():MyPopup.class.getSimpleName();
    private TextView hideView;
    protected Context mContext;
    private int mHeight;
    protected View mParentView;
    protected View mView;
    private PopupWindow pop;

    public MyPopup(Context context, int height) {
        this.mContext = context;
        this.mHeight = height;
        this.hideView = (TextView) ((Activity) context).findViewById(R.id.hideView);
    }

    public MyPopup(Context context, View parentView, int height) {
        this.mContext = context;
        this.mHeight = height;
        this.mParentView = parentView;
        this.hideView = (TextView) parentView.findViewById(R.id.hideView);
    }

    protected void initData() {
        this.pop = new PopupWindow(this.mView, -1, this.mHeight, true);
        this.pop.setFocusable(true);
        this.pop.setAnimationStyle(R.style.MenuAnimationFade);
        this.pop.setBackgroundDrawable(new BitmapDrawable());
    }

    public void changePopupWindowState() {
        if (this.pop.isShowing()) {
            this.pop.dismiss();
        } else {
            this.pop.showAtLocation(this.hideView, 80, 0, 0);
        }
    }
}
